# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=gnome-software-plugin-apk
pkgver=0.7.0
pkgrel=1
pkgdesc="APK plugin for GNOME Software"
url="https://github.com/Cogitri/gnome-software-plugin-apk"
arch="x86_64 aarch64" # apk-polkit
license="GPL-2.0-or-later"
depends="alpinelinux-appstream-data"
makedepends="meson gnome-software-dev gnome-software-static apk-polkit-dev"
options="!check" # no tests
source="https://github.com/Cogitri/gnome-software-plugin-apk/archive/v$pkgver/gnome-software-plugin-apk-$pkgver.tar.gz"

# We can't depend on gnome-software-plugin-apk directly in gnome-software
# since that causes a circular dep:
# gnome-software -> gnome-software-plugin-apk -> gnome-software-dev
case "$CARCH" in
	x86_64|aarch64) install_if="gnome-software" ;;
esac

build() {
	meson \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--buildtype=plain \
		. output
	ninja -C output
}

package() {
	DESTDIR="$pkgdir" ninja -C output install
}

sha512sums="fd1e470d926f795584dee2a48f55b54ae2e88d446eb6d85cbbcc98ecc6121da1c7dbb81266d927f3fa19e04fb04fed4a9512f994819f762ae56bc72c321b52db  gnome-software-plugin-apk-0.7.0.tar.gz"
